#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

int doans(char *a, char *b)
{
	int i = 0;
	int j = 0;
	while(a[i]) 
	{
		if(b[j] == 0) return 0;
		if(a[i] == b[j++])
		{
			i++;
		}
	}
	return 1;
}

char a[1000000], b[1000000];

int main()
{
	
	while(~scanf("%s%s", a, b))
	{
		printf("%s\n", doans(a, b) == 1 ? "Yes" : "No");
	}
	return 0;
}
